import { NgModule } from '@angular/core'
import { Routes, RouterModule } from '@angular/router'
import { ListRouterGuardClass } from '@shared/classes/ListRouterGuardClass'
import { ListReuseGuardClass } from '@shared/classes/ListReuseGuardClass'
import { ListComponent } from './list/list.component'
import { NewComponent } from './new/new.component'
import { NewRouterGuardClass } from '@shared/classes/NewRouterGuardClass'
import { UploadComponent } from './upload/upload.component'

const routes: Routes = [
  { path: '', redirectTo: 'list', pathMatch: 'full' },
  {
    path: 'list',
    component: ListComponent,
    canActivate: [ListRouterGuardClass, ListReuseGuardClass],
    pathMatch: 'full',
    data: {
      title: 'MENU.BIZ.BATCH_REGISTER',
      titleI18n: 'MENU.BIZ.BATCH_REGISTER',
      reuse: true,
    },
  },
  {
    path: 'new',
    component: NewComponent,
    canDeactivate: [NewRouterGuardClass],
    data: {
      breadcrumb: 'GENERAL.INFO.BREADCRUMB.CREATE',
      titleI18n: 'BIZ.STORE.TITLE.CREATE',
    },
  },
  {
    path: 'upload',
    component: UploadComponent,
    canDeactivate: [NewRouterGuardClass],
    data: {
      breadcrumb: 'BATCH.IMPORT.FILE.ADD',
      titleI18n: 'BATCH.IMPORT.FILE.ADD',
    },
  },
]

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
export class BatchImportRoutingModule {}
